namespace Logic.Map.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class alertTable : DbMigration
    {
        public override void Up()
        {
            AddColumn("dbo.HistoryGudaoCar", "IsRecovery", c => c.Boolean());
            AddColumn("dbo.HistoryGudaoCar", "RecoveryTime", c => c.DateTime());
            AddColumn("dbo.HistoryGudaoCar", "DuiWeiOper_F_Id", c => c.String(maxLength: 128));
            AddColumn("dbo.HistoryGudaoCar", "RecoveryOper_F_Id", c => c.String(maxLength: 128));
            CreateIndex("dbo.HistoryGudaoCar", "DuiWeiOper_F_Id");
            CreateIndex("dbo.HistoryGudaoCar", "RecoveryOper_F_Id");
            AddForeignKey("dbo.HistoryGudaoCar", "DuiWeiOper_F_Id", "dbo.OperationGudaoCar", "F_Id");
            AddForeignKey("dbo.HistoryGudaoCar", "RecoveryOper_F_Id", "dbo.OperationGudaoCar", "F_Id");
        }
        
        public override void Down()
        {
            DropForeignKey("dbo.HistoryGudaoCar", "RecoveryOper_F_Id", "dbo.OperationGudaoCar");
            DropForeignKey("dbo.HistoryGudaoCar", "DuiWeiOper_F_Id", "dbo.OperationGudaoCar");
            DropIndex("dbo.HistoryGudaoCar", new[] { "RecoveryOper_F_Id" });
            DropIndex("dbo.HistoryGudaoCar", new[] { "DuiWeiOper_F_Id" });
            DropColumn("dbo.HistoryGudaoCar", "RecoveryOper_F_Id");
            DropColumn("dbo.HistoryGudaoCar", "DuiWeiOper_F_Id");
            DropColumn("dbo.HistoryGudaoCar", "RecoveryTime");
            DropColumn("dbo.HistoryGudaoCar", "IsRecovery");
        }
    }
}
